1 <html>
2 <head>
3         <title>Customer </title>
4         <style>
5             body {
6   margin:
0;
7   font-family: Arial, Helvetica, sans-serif;
8   background: #
484848;
9 }
10 .topnav {
11   overflow: hidden;
12   background-color:#8d2663;
13   height: 70px;
14   border: 3px solid #b40a70;
15 }
16
17 .topnav a {
18   
float: left;
19   color: #f2f2f2;
20   text-align: center;
21   padding: 14px 16px;
22   text-decoration: none;
23   font-size: 35px;
24   font-weight: bold;
25 }
26 </style>
27
28     <body>
29     <div
class="topnav">
30             <a
class="active" href="home.html"><img src="ic_add_pet.png"></a>
31             <a href=
"customer.php">Customers</a>
32             
33           </div>
34 <?php
35
36 $servername =
"localhost";
37 $username =
"root";
38 $password =
"";
39 $dbname =
"Petshop_management";
40
41 // Create connection

42 $conn =
new mysqli($servername, $username, $password, $dbname);
43 // Check connection

44 if
($conn->connect_error) {
45     die(
"Connection failed: " . $conn->connect_error);
46 }

47 //echo
" CONNECTION ESTABLISHED \r\n";
48 //echo
" INSERTION IN PROCESS";
49 $cs_id=$_POST[
"t1"];
50 $Query2=
"select count(*) from customer where cs_id='$cs_id'";
51 $Execute = mysqli_query($conn,$Query2);
52 $count = mysqli_fetch_row($Execute);

53 if
($count[0]==1)
54 {
55     $sql =
"DELETE FROM customer WHERE cs_id='$cs_id'";
56     
if ($conn->query($sql) == TRUE) {
57         echo
'<div>
58         <h1 style=
"color:#f2f2f2;font-size:50px; font-family: "Roboto", sans-serif;margin:auto;">Data deleted successfully</h1>
59            </div>
';
60     }
else {
61         echo
"Error: " . $sql . "<br>" . $conn->error;
62     }
63     
64 }

65 else
{
66     echo
'<div>
67     <h1 style=
"color:#f2f2f2;font-size:40px; font-family: "Roboto", sans-serif;margin:auto;"> Data not found</h1>
68        </div>
';
69 }
70
71
72 $conn->close();
73 ?>
74  <form>
75        <button type=
"submit" style="height: 50px;width: 150px;cursor:pointer;border-radius:15px;
76 border: 3px solid #b40a70;background-color: #8d2663;color:#f2f2f2;font-size:15px;"
formaction="customer.php">back</button>
77 </form>
78 </body>
79 </html>


Gõ tìm kiếm nhanh...